home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #64 (1992-08-13)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #64 (1992-08-13)(Amiga User Gruppe Einzugsgebiet 4000).adf / TKEd / rexx / Comment-Block.tked next >
Text File  |  1992-06-12  |  2KB  |  58 lines

  1. /**
  2.  ** ARexx program to comment out a selected block 
  3.  **  
  4.  ** © Tom Kroener '92
  5.  **
  6.  **/
  7.  
  8. options results
  9. address 'TKEd.1'                /* Portname of the first started TKEd */
  10. Indent "OFF"                    /* No unwanted indents */
  11.  
  12. /* uncomment this for AREXX- or C- programs */
  13. /*
  14. scom  = "/** "
  15. mcom  = " ** "
  16. ecom  = " **/"
  17. */
  18.  
  19. /* uncomment this for Modula2- or Oberon- programs */
  20. scom  = "(** "
  21. mcom  = " ** "
  22. ecom  = " **)"
  23.  
  24. /* uncomment this for Assembler- programs */
  25. /*
  26. scom  = ";* "
  27. mcom  = ";* "
  28. ecom  = ";* "
  29. */
  30.  
  31.  
  32. FirstMarkedLine                    /* Look for the start of the block */
  33. Start = result
  34. IF Start = -1 THEN
  35.   DO; Request1 "No block marked"  /* Request and exit if nothing marked */
  36.      EXIT 10
  37.   END
  38.  
  39. GetLineNr                         /* Get number of the last marked line */
  40. End = result-1                    /* Cursor stands in the first unmarked 
  41.                                      line */
  42. UnmarkBlock
  43. GotoLine Start
  44. BeginOfLine
  45. WriteString scom                  /* Write start of comment */
  46. DO WHILE Start < END              /* Write until end of block */
  47.   BeginOfLine
  48.   Cursor "DOWN"                   /* One line down */
  49.   WriteString mcom                /* Write comment */
  50.   Start = Start + 1               /* Increment the counter for the lines */
  51. END;  
  52. EndOfLine                         /* All lines commented out */
  53. MakeReturn                        /* Insert a blank line for better looking */
  54. WriteString ecom                  /* Write end of the comment */
  55.  
  56. EXIT 0                            /* ciao */
  57.  
  58.